-- This file is part of the Fantasy Grounds Open Foundation Ruleset project. 
-- For the latest information, see http://www.fantasygrounds.com/
--
-- Copyright 2008 SmiteWorks Ltd.
--
-- This file is provided under the Open Game License version 1.0a
-- Refer to the license.html file for the full license text
--
-- All producers of work derived from this material are advised to
-- familiarize themselves with the license, and to take special
-- care in providing the definition of Product Identity (as specified
-- by the OGL) in their products.
--
-- All material submitted to the Open Foundation Ruleset project must
-- contain this notice in a manner applicable to the source file type.


trackerclasses = {};
dropclasses = {};

trackersortcallback = nil;

defaultentrytype = nil;

-- These functions control the type of entry created in the combat tracker by using the radial
function getDefaultTrackerType()
	return defaultentrytype;
end

function setDefaultTrackerType(defaulttype)
	defaultentrytype = defaulttype;
end

-- This function is used to register classes that are displayed as list items under a group in the tracker
function registerTrackerClass(trackerclass, dropclass)
	trackerclasses[dropclass] = trackerclass;
end

function getTrackerClass(dropclass)
	return trackerclasses[dropclass];
end

-- This function is used to register classes that you can use in combats and on the tracker
function registerDropClass(dropclass, namefield, tokenfield)
	local d = { ['namefield'] = namefield, ['tokenfield'] = tokenfield };
	dropclasses[dropclass] = d;
end

function getDropClass(dropclass)
	return dropclasses[dropclass];
end


-- This function is used to register a callback function that performs rules system specific sorting on the combat tracker entries
function registerTrackerSortCallback(callback)
	trackersortcallback = callback;
end

function getTrackerSortCallback()
	return trackersortcallback;
end
